package cn.z2huo.knowledge.basic.exception.finallyy;

/**
 * <p>finally 块中没有 return
 *
 * @author z2huo
 */
class FinallyNoneReturn {

    public int inc() {
        int x;
        try {
            x = 1;
//            int i = 1/0;
//            if (true) throw new RuntimeException();
            return x;
        } catch (ArithmeticException e) {
            x = 2;
            return x;
        } finally {
            x = 3;
            return x;
        }
    }

    public static void main(String[] args) {
        FinallyNoneReturn f = new FinallyNoneReturn();
        System.out.println(f.inc());
    }

}
